package cn.calm.entity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.Table;
import javax.persistence.Transient;

import cn.calm.commons.entity.BaseEntity;

@Entity
@Table(name = "vw_user_menu_application")
@IdClass(UserMenuApplicationKey.class)   
public class UserMenuApplication implements BaseEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	@Id
	@Column(name = "user_Id")
	private String userId;
	@Id
	@Column(name = "menu_Id")
	private String menuId;
	@Column(name = "menu_name")
	private String menuName;
	@Column(name = "parent_id")
	private String parentId;
	@Column(name = "application_id")
	private String applicationId;
	private String path;
	private String icon;
	private String type;


	public String getMenuName() {
		return menuName;
	}

	public void setMenuName(String menuName) {
		this.menuName = menuName;
	}

	public String getParentId() {
		return parentId;
	}

	public void setParentId(String parentId) {
		this.parentId = parentId;
	}

	public String getApplicationId() {
		return applicationId;
	}

	public void setApplicationId(String applicationId) {
		this.applicationId = applicationId;
	}

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	@Override
	@Transient
	public Object getValue() {
		return getMenuName();
	}

	@Override
	@Transient
	public String getDisplayName() {
		return "用户菜单";
	}

	@Override
	@Transient
	public UserMenuApplication getId() {
		return this;
	}

	@Transient
	public String getName() {
		return menuName;
	}

	public void setId(UserMenuApplication id) {
		setMenuId(id.getMenuId());
		setUserId(id.getUserId());
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getMenuId() {
		return menuId;
	}

	public void setMenuId(String menuId) {
		this.menuId = menuId;
	}
}
